<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ include file="../common.jsp" %>
<script type="text/javascript">
	$(document).ready(function(){
	 setWorkFlowURL('<c:out value="${flowExecutionUrl}" />');
		//setDocDetailURL('<c:out value="${flowExecutionUrl}" />');
	 createVaultDetailsDialog();
	 openVaultDetailsDialog();
	 setDialogDiv("vaultDetailsDiv");
	});
</script>
<div id="vaultDetailsDiv" title="Approve Document">
<form:form commandName="documentCustodianDetailsForm" id="custodianDetails" >
<form:hidden path="vaultId" value="${documentCustodianDetailsForm.vaultId}"/>
<table class="zeroBorder formBlockColor tableTextFont" border="0">
	<tr class="formSpacingRow formBlockColor"><td></td> </tr>
	<tr class="text ui-widget text-align-right">
		<td colspan="9" align="right">* (All fields are mandatory)</td>
	</tr>
		<tr class="formSpacingRow formBlockColor"><td></td> </tr>
	
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel"><label>Vault Number</label> </td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<form:input path="vaultNumber" id="vaultNumber" name="vaultNumber"/> 
		</td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel"><label>Vault Location</label> </td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<form:input path="vaultLocation" id="vaultLocation" name="vaultLocation"/> 
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td colspan="3" align="center">
			<form:errors path="vaultNumber" cssClass="text errorMsg"></form:errors>
		</td>
		<td class="spacingColumnWidthLess"></td>
		<td colspan="3" align="center">
			<form:errors path="vaultLocation" cssClass="text errorMsg"></form:errors>
		</td>	
		<td class="spacingColumnWidthLess"></td>	
	</tr>
	<tr class="formSpacingRow formBlockColor"><td></td> </tr>
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel">
			<label>Custodian Name</label> 
		</td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<form:input path="custodianName" id="custodianName" name="custodianName"/> 
		</td>
	</tr>
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td colspan="3" align="center">
			<form:errors path="custodianName" cssClass="text errorMsg"></form:errors>
		</td>
	</tr>
	<tr class="formSpacingRow formBlockColor"><td></td> </tr>		
	<tr class="formSpacingRow formBlockColor"><td></td> </tr>
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel">
			<label>Custodian Id</label> 
		</td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<form:input path="custodianId" id="custodianId" name="custodianId"/> 
		</td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel">
			<label>Custodian Designation</label> 
		</td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<form:input path="custodianDesig" id="custodianDesig"/>
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td colspan="3" align="center">
			<form:errors path="custodianId" cssClass="text errorMsg"></form:errors>
		</td>
		<td class="spacingColumnWidthLess"></td>
		<td colspan="3" align="center">
			<form:errors path="custodianDesig" cssClass="text errorMsg"></form:errors>
		</td>	
		<td class="spacingColumnWidthLess"></td>	
	</tr>
	<tr class="formSpacingRow formBlockColor"><td></td> </tr>
	<tr class="formSpacingRow formBlockColor"><td></td> </tr>
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel">
			<label>Custodian Business Unit</label>	<!-- changed from location to business unit on 25-02-2012 as told by shubh --> 
		</td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<form:select path="custodianLocId" cssClass="text ui-widget-content ui-corner-all" 
				onchange="loadDepttForBU(this.id,'custodianDepttId')">
				<form:option value="0">Choose Location</form:option>
				<c:forEach items="${BU_ID_NAME_MAP}" var="item">
					<form:option value="${item.key}">${item.value}</form:option>
				</c:forEach>
			</form:select> 
		</td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel">
			<label>Custodian Department</label> 
		</td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<form:select path="custodianDepttId" cssClass="text ui-widget-content ui-corner-all" id="custodianDepttId">
			<form:option value="0">Choose Department</form:option>
				<c:forEach items="${DEPTT_ID_NAME_MAP}" var="item">
					<form:option value="${item.key}">${item.value}</form:option>
				</c:forEach>
				</form:select> 
		</td>
	</tr>
	<tr class="formSpacingRow formBlockColor"><td></td> </tr>
	<tr class="formSpacingRow formBlockColor"><td></td> </tr>
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td align="right" valign="middle" colspan="7"> 
			<input type="hidden" value="${currentWfId}" name="currentWfId" id="currentWfId">
			<input type="hidden" value="${docId}" name="docId" id="docId">
			<c:choose>
				<c:when test="${documentCustodianDetailsForm.vaultId gt 0}">
					<input type="button" class="formButton" value="Update" onclick="approveOrRejectDocument('custodianDetails','approve')">&nbsp;
					<input type="button" class="formButton" value="Map Users" onclick="closeCurrentDialog();approveDocument('mapUsers');" >&nbsp;
					<input type="button" class="formButton" value="Cancel" onclick="closeCurrentDialog()">
				</c:when>
				<c:otherwise>
					<input type="button" class="formButton" value="Submit" onclick="approveOrRejectDocument('custodianDetails','approve')">&nbsp;
					<input type="button" class="formButton" value="Cancel" onclick="closeCurrentDialog()">
				</c:otherwise>
			</c:choose>
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
	
	<tr class="formSpacingRow formBlockColor"><td></td> </tr>
	</table>
</form:form>
</div>
